package com.chushouya.product.service.api.impl;

import com.general.framework.core.lang.Beans;
import com.chushouya.product.dao.repository.ProductSeriesRepository;
import com.chushouya.product.dto.admin.series.SeriesQuery;
import com.chushouya.product.dto.api.series.SeriesApiDTO;
import com.chushouya.product.service.api.ProductSeriesApiService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
@Slf4j
public class ProductSeriesApiServiceImpl implements ProductSeriesApiService {

    @Resource
    private ProductSeriesRepository productSeriesRepository;


    @Override
    public List<SeriesApiDTO> listProductSeries(SeriesQuery query) {
        return Beans.copyList(productSeriesRepository.selectList(query), SeriesApiDTO.class);
    }
}
